// pages/suggest/shopapply.js
var util=require('../../utils/util.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    shop:{}
  },
 
  bindcontact: function (e) {
    this.setData({
      'shop.contact': e.detail.value
    })
  },
  bindphone: function (e) {
    this.setData({
      'shop.phone': e.detail.value
    })
  },
  bindshopname: function (e) {
    this.setData({
      'shop.name': e.detail.value
    })
  },
  bindaddress: function (e) {
    this.setData({
      'shop.address': e.detail.value
    })
  },
  bindsubmit:function(){
    var url = util.url.user_shop_apply;
    var data = this.data.shop;
    util.fetchPost(
      url,
      data,
      function (ret) {
        if (ret.data.id) {
          util.showinfo("提交成功");
          wx.navigateBack();
        }
      }
    )
  }
})